Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support kCMPixelFormat_32BGRA and add github action for running tests #1

Open
wants to merge 15 commits into
base: 0.10
Choose a base branch
from

Conversation

darioalessandro
Copy link
Member

No description provided.

@darioalessandro darioalessandro changed the title [DO NOT REVIEW YET][WIP] Rename Yuyv to i420 [DO NOT REVIEW YET][WIP] Rename Yuyv to i420 and support kCMPixelFormat_32BGRA Dec 19, 2024
@@ -405,9 +496,10 @@ impl FormatDecoder for LumaAFormat {
/// let image: ImageBuffer<Rgb<u8>, Vec<u8>> = buffer.to_image::<YuyvFormat>();
/// ```
#[derive(Copy, Clone, Debug, Default, Hash, Ord, PartialOrd, Eq, PartialEq)]
pub struct YuyvFormat;
pub struct I420Format;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was never YUYV it was always meant to be i420

@darioalessandro darioalessandro changed the title [DO NOT REVIEW YET][WIP] Rename Yuyv to i420 and support kCMPixelFormat_32BGRA [DO NOT REVIEW YET][WIP] support kCMPixelFormat_32BGRA Dec 26, 2024
@darioalessandro darioalessandro changed the title [DO NOT REVIEW YET][WIP] support kCMPixelFormat_32BGRA Support kCMPixelFormat_32BGRA and add github action for running tests Dec 26, 2024
@@ -29,4 +29,4 @@ jobs:
- name: Cargo Check
run: |
cd examples/threaded-capture
cargo check
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert

2 => Mat::new_rows_cols_with_data::<GA8>(resolution.width() as i32, resolution.height() as i32, cast_slice(data)),
3 => Mat::new_rows_cols_with_data::<RGB8>(resolution.width() as i32, resolution.height() as i32, cast_slice(data)),
4 => Mat::new_rows_cols_with_data::<RGBA8>(resolution.width() as i32, resolution.height() as i32, cast_slice(data)),
1 => Mat::new_rows_cols_with_data::<G8>(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just cargo fmt

use crate::error::NokhwaError;
use crate::pixel_format::FormatDecoder;
use crate::types::{FrameFormat, Resolution};
use bytemuck::{cast_slice, Pod, Zeroable};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more cargo fmt

@@ -77,6 +77,16 @@ impl FormatDecoder for RgbFormat {
.collect()),
FrameFormat::RAWRGB => Ok(data.to_vec()),
FrameFormat::NV12 => nv12_to_rgb(resolution, data, false),
FrameFormat::BGRA => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the meat of the change

@@ -0,0 +1,38 @@

# Assets
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documenting how I added the test images and the license for the pyramid picture

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant